package com.example.speeddating.tool;


import com.example.speeddating.utils.SensitiveWordUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SensitiveTool {

    @Autowired
    private SensitiveWordUtil sensitiveWordUtil;


    public String filterText(String text){
        sensitiveWordUtil.initDictionary(sensitiveWordUtil.getDictionaryList());
        //⽂本中查找是否包含敏感词
        String s = SensitiveWordUtil.matchWords(text); //过滤
        return s;
    }
}
